package com.hnchances.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName grades
 */
@TableName(value ="grades")
@Data
public class Grades implements Serializable {
    /**
     * id,key，自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 课程关联id
     */
    @TableField(value = "courseID")
    private String courseID;

    /**
     * 考试关联id
     */
    @TableField(value = "examID")
    private Integer examID;

    /**
     * 班级关联id
     */
    @TableField(value = "classID")
    private Integer classID;

    /**
     * 成绩
     */
    @TableField(value = "grades")
    private Integer grades;

    /**
     * 0-正常，1-删除
     */
    @TableField(value = "status")
    private Integer status;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Grades other = (Grades) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCourseID() == null ? other.getCourseID() == null : this.getCourseID().equals(other.getCourseID()))
            && (this.getExamID() == null ? other.getExamID() == null : this.getExamID().equals(other.getExamID()))
            && (this.getClassID() == null ? other.getClassID() == null : this.getClassID().equals(other.getClassID()))
            && (this.getGrades() == null ? other.getGrades() == null : this.getGrades().equals(other.getGrades()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCourseID() == null) ? 0 : getCourseID().hashCode());
        result = prime * result + ((getExamID() == null) ? 0 : getExamID().hashCode());
        result = prime * result + ((getClassID() == null) ? 0 : getClassID().hashCode());
        result = prime * result + ((getGrades() == null) ? 0 : getGrades().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", courseID=").append(courseID);
        sb.append(", examID=").append(examID);
        sb.append(", classID=").append(classID);
        sb.append(", grades=").append(grades);
        sb.append(", status=").append(status);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}